﻿/*
   Copyright 2013 Dmitry Bratus

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading.Tasks;
using Spring.Aop;
using System.Collections;

namespace Flower.Services.Host
{
    /// <summary>
    /// Hosts an arbitrary WCF service.
    /// </summary>
    public class ServiceHostConfiguration
    {
        /// <summary>
        /// Service instance to be hosted.
        /// </summary>
        public object Service { get; set; }

        /// <summary>
        /// Service type name.
        /// </summary>
        public string ServiceType { get; set; }

        /// <summary>
        /// Base addresses of the service.
        /// </summary>
        public IList BaseAddresses { get; set; }

        /// <summary>
        /// Endpoints to expose.
        /// </summary>
        public IList Endpoints { get; set; }

        /// <summary>
        /// Service behaviors.
        /// </summary>
        public IList Behaviors { get; set; }
    }

    /// <summary>
    /// Endpoint of a WCF service.
    /// </summary>
    public class ServiceEndpointConfiguration
    {
        /// <summary>
        /// Type name of the contract interface, implemented by the endpoint.
        /// </summary>
        public string Contract { get; set; }

        /// <summary>
        /// Binding of the endpoint.
        /// </summary>
        public Binding Binding { get; set; }

        /// <summary>
        /// Address of the endpoint.
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// Listen URI of the endpoint.
        /// </summary>
        public string ListenUri { get; set; }
        
        /// <summary>
        /// Endpoint behaviors.
        /// </summary>
        public IList Behaviors { get; set; }
    }
}
